<template>
  <div>
    <header>
      <h1>海森堡电影</h1>
    </header>
  </div>
</template>
<script>
  export default {
    name: 'Header',
    data(){
      return{

      }
    },
    methods:{
      //注销
      logout(){
        const  that = this;
        //删除cookie并跳到登录页
        that.isLoging = true;//加载loading
        that.delCookie('session');
        //注销时  清除sessionStorage里面的数据
        sessionStorage.removeItem('userInfos');

        //演示
        setTimeout(()=>{
          that.$router.push('/login');
          that.isLoging = false;//去掉loading
        },1500)
      },
    }
  }
</script>
<style scoped lang="less">
  header{
    width: 100%;
    position: relative;
    height: 50px;
    line-height: 50px;
    text-align: center;
    color: #fff;
    background: #07c160;
    z-index: 9999;
    position: fixed;
    top: 0;
    h1{
      font-size: 17px;
      font-weight: 400;
    }
  }
</style>
